import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextLine()){
            String str = in.nextLine();
            int index = str.lastIndexOf(" ");//从后往前找，返回第一个空格的下标
            String ret = str.substring(index + 1);//从某个位置开始截取字符
            System.out.println(ret.length());
        }
    }
}
